package ljl.alg.wangzheng_camp.round1.recursive;

import commons.ListNode;

public class _offer_06_reverse_print {
    
    int[] res;
    int total, i;
    public int[] reversePrint(ListNode head) {
        if (head != null) {
            total++;
            reversePrint(head.next);
            res[i++] = head.val;
        }
        if (res == null) res = new int[total];
        return res;
    }
    
}
